﻿using System;
using System.Collections.Generic;
using System.Drawing;
using Microsoft.DirectX.DirectInput;
using KGE.Define;

namespace KGE
{
    [Serializable]
    public class Options
    {
        public Size WindowSizePixel = new Size(640, 480);
        public bool IsShowWindowBorder = true;
        public DrawMode DrawMode = DrawMode.GPU3D;
        public double Zoom = 1.0;
        public string ServerName = "ServerName";
        public string ServerIP = "127.0.0.1";
        public int ServerPort = 30000;
        public bool IsFullScreen = false;

        public Key KeyU = Key.Up;
        public Key KeyD = Key.Down;
        public Key KeyL = Key.Left;
        public Key KeyR = Key.Right;
        public Key KeyY = Key.Space;
        public Key KeyN = Key.Escape;

        public string FontName = "微软雅黑";
        public int FontSize = 16;
        public FontStyle FontStyle = FontStyle.Regular;

        Size tileSizePixel = new Size(16, 16);
        string rootPath = "data";

        public string RootPath
        {
            get
            {
                return @".\" + rootPath + @"\";
            }
        }
        public Size WindowSize
        {
            get
            {
                return new Size(WindowSizePixel.Width / TileSizePixel.Width, WindowSizePixel.Height / TileSizePixel.Height);
            }

        }
        public Size TileSizePixel
        {
            get
            {
                return new Size((int)(tileSizePixel.Width * Zoom), (int)(tileSizePixel.Height * Zoom));
            }
        }
    }
}
